slot
<!--
 * @Date: 2023-03-22 15:32:20
 * @LastEditTime: 2023-03-31 10:50:31
 * @FilePath: /NLK/src/components/common/CpageView/CpageView.vue
 * 介绍:
-->
<script lang="ts" setup>
import type RpullRefresh from "@@/components/rework/RpullRefresh/RpullRefresh.vue";
const props = defineProps<{
  pullRefresh?: boolean;
}>();
const RpullRefreshRef = ref<InstanceType<typeof RpullRefresh>>();
function pullRefreshSuccess() {
  RpullRefreshRef.value?.success();
}
function pullRefreshFail() {
  RpullRefreshRef.value?.fail();
}
function pullRefreshStart() {
  RpullRefreshRef.value?.start();
}
const emit = defineEmits<{
  (e: "refresh", v: any): void;
}>();
defineExpose({
  pullRefreshSuccess,
  pullRefreshFail,
  pullRefreshStart,
});
</script>

<template>
  <RpullRefresh
    class="CpageView"
    @refresh="(e) => emit('refresh', e)"
    ref="RpullRefreshRef"
    :disabled="!props.pullRefresh"
  >
    <slot></slot>
    <div class="slot-bottom">
      <slot name="buttom"></slot>
    </div>
  </RpullRefresh>
</template>

<style lang="less" scoped>
.CpageView {
  height: var(--page-H);
  width: 100vw;
  padding: var(--gap-md);
  overflow: auto;
  padding-bottom: calc(var(--tabbar-H) + var(--gap-md));
}

.slot-bottom {
  position: fixed;
  bottom: calc(var(--tabbar-H) + var(--gap-md));
  width: var(--page-W);
}
</style>
<style lang="less">
.CpageView {
  .van-pull-refresh__track {
    height: auto;
    min-height: 100%;
  }
}
</style>
